<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../layui/css/layui.css">
    <style>
        body {
            padding: 30px 50px 30px 10px;
        }

        #form-user-detail input{
            background-color: #e6e6e6;
        }
    </style>
</head>
<body>
<form class="layui-form" action="#" method="post" id="form-user-detail">
    <input type="hidden" name="id" id="id"/>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名称</label>
        <div class="layui-input-block">
            <input type="text" name="username" readonly id="username" required  lay-verify="required" placeholder="请输入用户名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户密码</label>
        <div class="layui-input-block">
            <input type="password" id="password" readonly name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户地址</label>
        <div class="layui-input-block">
            <input type="text" id="address" readonly name="address" required lay-verify="required" placeholder="请输入地址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">创建人</label>
        <div class="layui-input-block">
            <input type="text" id="createBy" readonly name="createBy" required lay-verify="required" placeholder="请输入创建人" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-block">
            <input type="text" id="createdate" disabled readonly name="createdate" required lay-verify="required" placeholder="请输入创建时间" autocomplete="off" class="layui-input">
        </div>
    </div>
</form>
<script type="text/javascript" src="../layui/layui.all.js"></script>
<script>
    layui.use(['form', 'layer','laydate','jquery'], function (form, layer,laydate,$) {
        laydate.render({
            elem: '#createdate'
            ,type: 'datetime'
            ,position: 'fixed'
        });

        $.ajax({
            type: "POST",
            url: "user?opr=detailShowData",
            data: {
            },
            async: false,
            error: function (request) {
            },
            success: function (data) {
                var user = $.parseJSON(data);
                $("#id").val(user.id);
                $("#username").val(user.username);
                $("#password").val(user.password);
                $("#address").val(user.address);
                $("#createBy").val(user.createby);
                $("#createdate").val(user.createdate);
            }
        });
    });
</script>
</body>
</html>